using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class tbs_PmtstoReviewMap : EntityTypeConfiguration<tbs_PmtstoReview>
    {
        public tbs_PmtstoReviewMap()
        {
            // Primary Key
            this.HasKey(t => new { t.ID, t.Date, t.Amount, t.Closedout });

            // Properties
            this.Property(t => t.ID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.Batch)
                .HasMaxLength(10);

            this.Property(t => t.origin)
                .HasMaxLength(10);

            this.Property(t => t.Account__)
                .HasMaxLength(40);

            this.Property(t => t.Type)
                .HasMaxLength(11);

            this.Property(t => t.document_type)
                .HasMaxLength(7);

            this.Property(t => t.Note)
                .HasMaxLength(100);

            this.Property(t => t.Cur)
                .HasMaxLength(5);

            this.Property(t => t.Cash_account)
                .HasMaxLength(20);

            this.Property(t => t.CC__Check_)
                .HasMaxLength(20);

            this.Property(t => t.CC_Type)
                .HasMaxLength(20);

            this.Property(t => t.CC_Expiry)
                .HasMaxLength(4);

            // Table & Column Mappings
            this.ToTable("tbs_PmtstoReview");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.Batch).HasColumnName("Batch");
            this.Property(t => t.origin).HasColumnName("origin");
            this.Property(t => t.Account__).HasColumnName("Account_#");
            this.Property(t => t.Type).HasColumnName("Type");
            this.Property(t => t.document_type).HasColumnName("document_type");
            this.Property(t => t.Date).HasColumnName("Date");
            this.Property(t => t.Note).HasColumnName("Note");
            this.Property(t => t.Cur).HasColumnName("Cur");
            this.Property(t => t.Amount).HasColumnName("Amount");
            this.Property(t => t.Base_1).HasColumnName("Base_1");
            this.Property(t => t.Base_2).HasColumnName("Base_2");
            this.Property(t => t.Cash_account).HasColumnName("Cash_account");
            this.Property(t => t.CC__Check_).HasColumnName("CC#_Check#");
            this.Property(t => t.CC_Type).HasColumnName("CC_Type");
            this.Property(t => t.CC_Expiry).HasColumnName("CC_Expiry");
            this.Property(t => t.Closedout).HasColumnName("Closedout");
        }
    }
}
